/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package memsim;
import memsim.instructions.*;

/**
 *
 * @author Joe
 * This class simulates all of the ALU and Vector ALU operations
 */
public class Alu {

	private boolean overflow = false;
        private boolean negative = false;
        private boolean zero = false;
        private boolean underflow = false;
        public ADDS adds = new ADDS();
        public ANDS ands = new ANDS();
        public NOTS nots = new NOTS();
        public ORS ors = new ORS();
        public SHIFTS shifts = new SHIFTS();
        public SUBS subs = new SUBS();
        public BR br = new BR();
        public STRS strs = new STRS();
        public LDR ldr = new LDR();
        public static int cycle = 0;

     /**
     * @return the overflow
     */
    public boolean isOverflow() {
        return overflow;
    }

    public static void updateCycle(int c)
    {
        cycle += c;
    }

    public static int getCycleCount()
    {
        return cycle;
    }

    /**
     * @param overflow the overflow to set
     */
    public void setOverflow(boolean overflow) {
        this.overflow = overflow;
    }

    /**
     * @return the negative
     */
    public boolean isNegative() {
        return negative;
    }

    /**
     * @param negative the negative to set
     */
    public void setNegative(boolean negative) {
        this.negative = negative;
    }

    /**
     * @return the zero
     */
    public boolean isZero() {
        return zero;
    }

    /**
     * @param zero the zero to set
     */
    public void setZero(boolean zero) {
        this.zero = zero;
    }

    /**
     * @return the underflow
     */
    public boolean isUnderflow() {
        return underflow;
    }

    /**
     * @param underflow the underflow to set
     */
    public void setUnderflow(boolean underflow) {
        this.underflow = underflow;
    }




}
